Conditions | 3 |
Paths | 6 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | /* globals versionCompare, atob, btoa */ |
||
28 | this.load = function () { |
||
29 | try { |
||
30 | let storedPlayer = localStorage.getItem('player'); |
||
31 | if (!storedPlayer) { |
||
32 | this.initSave(); |
||
33 | } else { |
||
34 | state.player = JSON.parse(storedPlayer); |
||
35 | this.versionControl(); |
||
36 | } |
||
37 | } catch (err) { |
||
38 | alert('Error loading savegame, reset forced.'); |
||
39 | this.initSave(); |
||
40 | } |
||
41 | }; |
||
42 | |||
54 |